﻿using System.Collections;
using System.Reflection;

namespace Gmantis.Controls.DataGrid
{
    internal class DeclarationOrderComparator : IComparer
    {
        int IComparer.Compare(object x, object y)
        {
            PropertyInfo info = (PropertyInfo)x;
            PropertyInfo info2 = (PropertyInfo)y;
            int metadataToken = 0x7fffffff;
            int num2 = 0x7fffffff;
            if (info.GetType().FullName == "System.Reflection.RuntimePropertyInfo")
            {
                metadataToken = info.MetadataToken;
            }
            if (info2.GetType().FullName == "System.Reflection.RuntimePropertyInfo")
            {
                num2 = info2.MetadataToken;
            }
            return metadataToken.CompareTo(num2);
        }
    }
}
